home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-01-24 | 6.9 KB | [TEXT/MMCC] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Tue Jan 24 04:16:10 1995, modified Tue Jan 24 04:16:10 1995, creator 'MMCC', type ASCII, 6365 bytes "TestLuminance.c" , at 0x195d 464 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MMCC] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 54 65 73 74 4c 75 | 6d 69 6e 61 6e 63 65 2e |..TestLu|minance.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 18 dd 00 | 00 01 d0 ab 4a 75 da ab |........|....Ju..|
|00000060| 4a 75 da 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Ju......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 c5 65 00 00 |........|.....e..|
|00000080| 2f 2a 0d 54 65 73 74 4c | 75 6d 69 6e 61 6e 63 65 |/*.TestL|uminance|
|00000090| 2e 63 0d 61 20 73 69 6d | 70 6c 65 20 64 72 69 76 |.c.a sim|ple driv|
|000000a0| 65 72 20 74 6f 20 74 65 | 73 74 20 73 6f 6d 65 20 |er to te|st some |
|000000b0| 6f 66 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 61 |of the f|unctiona|
|000000c0| 6c 69 74 79 20 6f 66 20 | 4c 75 6d 69 6e 61 6e 63 |lity of |Luminanc|
|000000d0| 65 2e 63 0d 48 49 53 54 | 4f 52 59 3a 0d 38 2f 31 |e.c.HIST|ORY:.8/1|
|000000e0| 35 2f 38 39 20 64 67 70 | 20 77 72 6f 74 65 20 69 |5/89 dgp| wrote i|
|000000f0| 74 2e 0d 31 30 2f 31 32 | 2f 39 30 20 64 67 70 09 |t..10/12|/90 dgp.|
|00000100| 75 70 64 61 74 65 64 20 | 69 74 2e 0d 31 30 2f 31 |updated |it..10/1|
|00000110| 37 2f 39 30 20 64 67 70 | 09 74 69 64 69 65 64 20 |7/90 dgp|.tidied |
|00000120| 75 70 20 74 68 65 20 74 | 69 6d 69 6e 67 20 70 72 |up the t|iming pr|
|00000130| 69 6e 74 20 6f 75 74 2e | 0d 38 2f 32 34 2f 39 31 |int out.|.8/24/91|
|00000140| 09 64 67 70 09 4d 61 64 | 65 20 63 6f 6d 70 61 74 |.dgp.Mad|e compat|
|00000150| 69 62 6c 65 20 77 69 74 | 68 20 54 48 49 4e 4b 20 |ible wit|h THINK |
|00000160| 43 20 35 2e 30 2e 0d 38 | 2f 32 37 2f 39 32 09 64 |C 5.0..8|/27/92.d|
|00000170| 67 70 09 72 65 70 6c 61 | 63 65 20 53 79 73 45 6e |gp.repla|ce SysEn|
|00000180| 76 69 72 6f 6e 73 28 29 | 20 62 79 20 47 65 73 74 |virons()| by Gest|
|00000190| 61 6c 74 28 29 0d 31 32 | 2f 32 31 2f 39 32 20 64 |alt().12|/21/92 d|
|000001a0| 67 70 20 64 6f 6e 27 74 | 20 61 73 73 75 6d 65 20 |gp don't| assume |
|000001b0| 38 2d 62 69 74 20 64 61 | 63 73 2e 0d 2a 2f 0d 23 |8-bit da|cs..*/.#|
|000001c0| 69 6e 63 6c 75 64 65 20 | 22 56 69 64 65 6f 54 6f |include |"VideoTo|
|000001d0| 6f 6c 62 6f 78 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |olbox.h"|.#includ|
|000001e0| 65 20 3c 6d 61 74 68 2e | 68 3e 0d 23 69 6e 63 6c |e <math.|h>.#incl|
|000001f0| 75 64 65 20 3c 61 73 73 | 65 72 74 2e 68 3e 0d 23 |ude <ass|ert.h>.#|
|00000200| 69 6e 63 6c 75 64 65 20 | 22 4c 75 6d 69 6e 61 6e |include |"Luminan|
|00000210| 63 65 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ce.h".#i|nclude <|
|00000220| 46 6f 6e 74 73 2e 68 3e | 0d 23 69 66 20 28 54 48 |Fonts.h>|.#if (TH|
|00000230| 49 4e 4b 5f 43 20 7c 7c | 20 54 48 49 4e 4b 5f 43 |INK_C ||| THINK_C|
|00000240| 50 4c 55 53 29 0d 09 23 | 69 6e 63 6c 75 64 65 20 |PLUS)..#|include |
|00000250| 3c 63 6f 6e 73 6f 6c 65 | 2e 68 3e 0d 09 23 69 6e |<console|.h>..#in|
|00000260| 63 6c 75 64 65 20 3c 70 | 72 6f 66 69 6c 65 2e 68 |clude <p|rofile.h|
|00000270| 3e 0d 23 65 6e 64 69 66 | 0d 23 69 66 20 5f 5f 4d |>.#endif|.#if __M|
|00000280| 57 45 52 4b 53 5f 5f 0d | 09 23 69 6e 63 6c 75 64 |WERKS__.|.#includ|
|00000290| 65 20 3c 53 49 4f 55 58 | 2e 68 3e 0d 23 65 6e 64 |e <SIOUX|.h>.#end|
|000002a0| 69 66 0d 0d 76 6f 69 64 | 20 54 65 73 74 4c 75 6d |if..void| TestLum|
|000002b0| 69 6e 61 6e 63 65 28 76 | 6f 69 64 29 3b 0d 0d 76 |inance(v|oid);..v|
|000002c0| 6f 69 64 20 6d 61 69 6e | 28 76 6f 69 64 29 0d 7b |oid main|(void).{|
|000002d0| 0d 09 52 65 71 75 69 72 | 65 28 67 65 73 74 61 6c |..Requir|e(gestal|
|000002e0| 74 38 42 69 74 51 44 29 | 3b 0d 09 54 65 73 74 4c |t8BitQD)|;..TestL|
|000002f0| 75 6d 69 6e 61 6e 63 65 | 28 29 3b 0d 7d 0d 0d 76 |uminance|();.}..v|
|00000300| 6f 69 64 20 54 65 73 74 | 4c 75 6d 69 6e 61 6e 63 |oid Test|Luminanc|
|00000310| 65 28 76 6f 69 64 29 0d | 7b 0d 09 72 65 67 69 73 |e(void).|{..regis|
|00000320| 74 65 72 20 69 6e 74 20 | 69 3b 0d 09 73 74 61 74 |ter int |i;..stat|
|00000330| 69 63 20 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ic Lumin|anceReco|
|00000340| 72 64 20 4c 52 3b 0d 09 | 72 65 67 69 73 74 65 72 |rd LR;..|register|
|00000350| 20 64 6f 75 62 6c 65 20 | 4c 2c 56 3b 0d 09 72 65 | double |L,V;..re|
|00000360| 67 69 73 74 65 72 20 64 | 6f 75 62 6c 65 20 64 4c |gister d|ouble dL|
|00000370| 2c 64 56 3b 0d 09 75 6e | 73 69 67 6e 65 64 20 6c |,dV;..un|signed l|
|00000380| 6f 6e 67 20 74 2c 72 65 | 70 73 3d 31 30 30 3b 0d |ong t,re|ps=100;.|
|00000390| 09 64 6f 75 62 6c 65 20 | 74 6f 6c 65 72 61 6e 63 |.double |toleranc|
|000003a0| 65 3b 0d 09 64 6f 75 62 | 6c 65 20 4c 30 2c 4c 31 |e;..doub|le L0,L1|
|000003b0| 3b 0d 09 69 6e 74 20 6e | 3b 0d 09 64 6f 75 62 6c |;..int n|;..doubl|
|000003c0| 65 20 63 2c 62 69 74 73 | 3b 0d 09 64 6f 75 62 6c |e c,bits|;..doubl|
|000003d0| 65 20 65 5b 35 31 32 5d | 2c 6d 65 61 6e 2c 73 64 |e e[512]|,mean,sd|
|000003e0| 2c 6d 61 78 2c 4c 47 6f | 74 3b 0d 0d 09 2f 2a 20 |,max,LGo|t;.../* |
|000003f0| 4c 75 6d 69 6e 61 6e 63 | 65 2e 63 20 69 6e 63 6c |Luminanc|e.c incl|
|00000400| 75 64 65 73 20 61 20 72 | 65 63 75 72 73 69 76 65 |udes a r|ecursive|
|00000410| 20 72 6f 75 74 69 6e 65 | 20 74 68 61 74 20 72 65 | routine| that re|
|00000420| 71 75 69 72 65 73 20 6c | 6f 74 73 20 6f 66 20 73 |quires l|ots of s|
|00000430| 74 61 63 6b 20 73 70 61 | 63 65 20 2a 2f 0d 09 53 |tack spa|ce */..S|
|00000440| 74 61 63 6b 47 72 6f 77 | 28 31 30 30 30 30 29 3b |tackGrow|(10000);|
|00000450| 09 09 2f 2a 20 49 6e 63 | 72 65 61 73 65 20 73 74 |../* Inc|rease st|
|00000460| 61 63 6b 20 2a 2f 0d 09 | 61 73 73 65 72 74 28 53 |ack */..|assert(S|
|00000470| 74 61 63 6b 53 70 61 63 | 65 28 29 3e 31 30 30 30 |tackSpac|e()>1000|
|00000480| 30 29 3b 0d 09 4d 61 78 | 41 70 70 6c 5a 6f 6e 65 |0);..Max|ApplZone|
|00000490| 28 29 3b 09 09 09 2f 2a | 20 45 78 70 61 6e 64 20 |();.../*| Expand |
|000004a0| 68 65 61 70 20 74 6f 20 | 74 68 65 20 6c 69 6d 69 |heap to |the limi|
|000004b0| 74 2e 20 2a 2f 0d 0d 09 | 4d 61 78 69 6d 69 7a 65 |t. */...|Maximize|
|000004c0| 43 6f 6e 73 6f 6c 65 48 | 65 69 67 68 74 28 29 3b |ConsoleH|eight();|
|000004d0| 0d 09 23 69 66 20 28 54 | 48 49 4e 4b 5f 43 20 7c |..#if (T|HINK_C ||
|000004e0| 7c 20 54 48 49 4e 4b 5f | 43 50 4c 55 53 29 0d 09 || THINK_|CPLUS)..|
|000004f0| 09 63 6f 6e 73 6f 6c 65 | 5f 6f 70 74 69 6f 6e 73 |.console|_options|
|00000500| 2e 6e 63 6f 6c 73 3d 31 | 30 30 3b 0d 09 09 70 72 |.ncols=1|00;...pr|
|00000510| 69 6e 74 66 28 22 5c 6e | 22 29 3b 0d 09 09 49 6e |intf("\n|");...In|
|00000520| 69 74 50 72 6f 66 69 6c | 65 28 32 30 30 2c 32 29 |itProfil|e(200,2)|
|00000530| 3b 0d 09 23 65 6c 69 66 | 20 5f 5f 4d 57 45 52 4b |;..#elif| __MWERK|
|00000540| 53 5f 5f 0d 09 09 53 49 | 4f 55 58 53 65 74 74 69 |S__...SI|OUXSetti|
|00000550| 6e 67 73 2e 63 6f 6c 75 | 6d 6e 73 3d 31 30 30 3b |ngs.colu|mns=100;|
|00000560| 0d 09 23 65 6c 73 65 0d | 09 20 20 20 09 2f 2a 20 |..#else.|. ./* |
|00000570| 49 4e 49 54 49 41 4c 49 | 5a 45 20 51 75 69 63 6b |INITIALI|ZE Quick|
|00000580| 44 72 61 77 20 2a 2f 0d | 09 09 49 6e 69 74 47 72 |Draw */.|..InitGr|
|00000590| 61 66 28 26 71 64 2e 74 | 68 65 50 6f 72 74 29 3b |af(&qd.t|hePort);|
|000005a0| 0d 09 09 49 6e 69 74 46 | 6f 6e 74 73 28 29 3b 0d |...InitF|onts();.|
|000005b0| 09 09 49 6e 69 74 57 69 | 6e 64 6f 77 73 28 29 3b |..InitWi|ndows();|
|000005c0| 0d 09 09 49 6e 69 74 43 | 75 72 73 6f 72 28 29 3b |...InitC|ursor();|
|000005d0| 0d 09 23 65 6e 64 69 66 | 0d 09 0d 09 23 69 6e 63 |..#endif|....#inc|
|000005e0| 6c 75 64 65 20 22 4c 75 | 6d 69 6e 61 6e 63 65 52 |lude "Lu|minanceR|
|000005f0| 65 63 6f 72 64 31 2e 68 | 22 09 0d 09 70 72 69 6e |ecord1.h|"...prin|
|00000600| 74 66 28 22 54 65 73 74 | 20 53 65 74 52 61 6e 67 |tf("Test| SetRang|
|00000610| 65 20 61 6e 64 20 53 65 | 74 4c 75 6d 69 6e 61 6e |e and Se|tLuminan|
|00000620| 63 65 5c 6e 22 29 3b 0d | 09 63 3d 31 2e 30 3b 0d |ce\n");.|.c=1.0;.|
|00000630| 09 4c 3d 28 4c 52 2e 4c | 4d 69 6e 2b 4c 52 2e 4c |.L=(LR.L|Min+LR.L|
|00000640| 4d 61 78 29 2f 32 2e 30 | 3b 0d 09 66 6f 72 28 69 |Max)/2.0|;..for(i|
|00000650| 3d 30 3b 69 3c 31 35 3b | 69 2b 2b 29 7b 0d 09 09 |=0;i<15;|i++){...|
|00000660| 4c 30 3d 4c 2a 28 31 2e | 30 2d 63 29 3b 0d 09 09 |L0=L*(1.|0-c);...|
|00000670| 4c 31 3d 4c 2a 28 31 2e | 30 2b 63 29 3b 0d 09 09 |L1=L*(1.|0+c);...|
|00000680| 74 6f 6c 65 72 61 6e 63 | 65 3d 53 65 74 4c 75 6d |toleranc|e=SetLum|
|00000690| 69 6e 61 6e 63 65 28 4e | 55 4c 4c 2c 26 4c 52 2c |inance(N|ULL,&LR,|
|000006a0| 30 2c 4c 2c 4c 30 2c 4c | 31 29 3b 0d 09 09 70 72 |0,L,L0,L|1);...pr|
|000006b0| 69 6e 74 66 28 22 63 25 | 39 2e 36 66 2c 20 22 2c |intf("c%|9.6f, ",|
|000006c0| 63 29 3b 0d 09 09 70 72 | 69 6e 74 66 28 22 52 61 |c);...pr|intf("Ra|
|000006d0| 6e 67 65 25 35 2e 31 66 | 25 35 2e 31 66 2c 20 22 |nge%5.1f|%5.1f, "|
|000006e0| 2c 4c 30 2c 4c 31 29 3b | 0d 09 09 70 72 69 6e 74 |,L0,L1);|...print|
|000006f0| 66 28 22 66 69 78 65 64 | 20 25 31 64 2f 25 31 64 |f("fixed| %1d/%1d|
|00000700| 2c 20 22 2c 4c 52 2e 66 | 69 78 65 64 2c 4c 52 2e |, ",LR.f|ixed,LR.|
|00000710| 64 61 63 73 29 3b 0d 09 | 09 70 72 69 6e 74 66 28 |dacs);..|.printf(|
|00000720| 22 4c 28 56 46 69 78 65 | 64 29 3d 25 35 2e 31 66 |"L(VFixe|d)=%5.1f|
|00000730| 20 63 64 2f 6d 5e 32 2c | 20 22 2c 56 54 6f 4c 28 | cd/m^2,| ",VToL(|
|00000740| 26 4c 52 2c 4c 52 2e 56 | 46 69 78 65 64 29 29 3b |&LR,LR.V|Fixed));|
|00000750| 0d 09 09 62 69 74 73 3d | 6c 6f 67 28 28 4c 52 2e |...bits=|log((LR.|
|00000760| 4c 4d 61 78 2d 4c 52 2e | 4c 4d 69 6e 29 2f 74 6f |LMax-LR.|LMin)/to|
|00000770| 6c 65 72 61 6e 63 65 29 | 2f 6c 6f 67 28 32 2e 30 |lerance)|/log(2.0|
|00000780| 29 3b 0d 09 09 70 72 69 | 6e 74 66 28 22 74 6f 6c |);...pri|ntf("tol|
|00000790| 65 72 61 6e 63 65 25 36 | 2e 33 66 3d 25 34 2e 31 |erance%6|.3f=%4.1|
|000007a0| 66 20 62 69 74 73 5c 6e | 22 2c 74 6f 6c 65 72 61 |f bits\n|",tolera|
|000007b0| 6e 63 65 2c 62 69 74 73 | 29 3b 0d 09 09 63 20 2a |nce,bits|);...c *|
|000007c0| 3d 20 30 2e 35 3b 0d 09 | 7d 0d 0d 09 70 72 69 6e |= 0.5;..|}...prin|
|000007d0| 74 66 28 22 54 65 73 74 | 20 53 65 74 4c 75 6d 69 |tf("Test| SetLumi|
|000007e0| 6e 61 6e 63 65 73 41 6e | 64 52 61 6e 67 65 20 26 |nancesAn|dRange &|
|000007f0| 20 47 65 74 4c 75 6d 69 | 6e 61 6e 63 65 5c 6e 22 | GetLumi|nance\n"|
|00000800| 29 3b 0d 09 4c 30 3d 4c | 52 2e 4c 4d 69 6e 3b 0d |);..L0=L|R.LMin;.|
|00000810| 09 4c 31 3d 4c 52 2e 4c | 4d 61 78 3b 0d 09 74 6f |.L1=LR.L|Max;..to|
|00000820| 6c 65 72 61 6e 63 65 3d | 53 65 74 4c 75 6d 69 6e |lerance=|SetLumin|
|00000830| 61 6e 63 65 73 41 6e 64 | 52 61 6e 67 65 28 4e 55 |ancesAnd|Range(NU|
|00000840| 4c 4c 2c 26 4c 52 2c 30 | 2c 4c 52 2e 56 4d 61 78 |LL,&LR,0|,LR.VMax|
|00000850| 2c 4c 30 2c 4c 31 2c 4c | 30 2c 4c 31 29 3b 0d 09 |,L0,L1,L|0,L1);..|
|00000860| 70 72 69 6e 74 66 28 22 | 52 61 6e 67 65 20 25 35 |printf("|Range %5|
|00000870| 2e 31 66 20 25 35 2e 31 | 66 2c 20 22 2c 4c 30 2c |.1f %5.1|f, ",L0,|
|00000880| 4c 31 29 3b 0d 09 70 72 | 69 6e 74 66 28 22 66 69 |L1);..pr|intf("fi|
|00000890| 78 65 64 20 25 31 64 2f | 25 31 64 2c 20 22 2c 4c |xed %1d/|%1d, ",L|
|000008a0| 52 2e 66 69 78 65 64 2c | 4c 52 2e 64 61 63 73 29 |R.fixed,|LR.dacs)|
|000008b0| 3b 0d 09 70 72 69 6e 74 | 66 28 22 4c 28 56 46 69 |;..print|f("L(VFi|
|000008c0| 78 65 64 29 3d 25 35 2e | 31 66 20 63 64 2f 6d 5e |xed)=%5.|1f cd/m^|
|000008d0| 32 2c 20 22 2c 56 54 6f | 4c 28 26 4c 52 2c 4c 52 |2, ",VTo|L(&LR,LR|
|000008e0| 2e 56 46 69 78 65 64 29 | 29 3b 0d 09 62 69 74 73 |.VFixed)|);..bits|
|000008f0| 3d 6c 6f 67 28 28 4c 52 | 2e 4c 4d 61 78 2d 4c 52 |=log((LR|.LMax-LR|
|00000900| 2e 4c 4d 69 6e 29 2f 74 | 6f 6c 65 72 61 6e 63 65 |.LMin)/t|olerance|
|00000910| 29 2f 6c 6f 67 28 32 2e | 30 29 3b 0d 09 70 72 69 |)/log(2.|0);..pri|
|00000920| 6e 74 66 28 22 74 6f 6c | 65 72 61 6e 63 65 20 25 |ntf("tol|erance %|
|00000930| 31 30 2e 33 66 20 3d 20 | 25 31 30 2e 33 66 20 62 |10.3f = |%10.3f b|
|00000940| 69 74 73 5c 6e 22 2c 74 | 6f 6c 65 72 61 6e 63 65 |its\n",t|olerance|
|00000950| 2c 62 69 74 73 29 3b 0d | 09 64 4c 3d 28 4c 31 2d |,bits);.|.dL=(L1-|
|00000960| 4c 30 29 2f 4c 52 2e 56 | 4d 61 78 3b 0d 09 70 72 |L0)/LR.V|Max;..pr|
|00000970| 69 6e 74 66 28 22 25 31 | 30 73 20 25 31 30 73 20 |intf("%1|0s %10s |
|00000980| 25 31 30 73 5c 6e 22 2c | 22 4c 20 72 65 71 75 65 |%10s\n",|"L reque|
|00000990| 73 74 65 64 22 2c 22 4c | 20 72 65 63 65 69 76 65 |sted","L| receive|
|000009a0| 64 22 2c 22 45 72 72 6f | 72 22 29 3b 0d 09 6e 3d |d","Erro|r");..n=|
|000009b0| 4c 52 2e 56 4d 61 78 2b | 31 3b 0d 09 69 66 28 6e |LR.VMax+|1;..if(n|
|000009c0| 3e 73 69 7a 65 6f 66 28 | 65 29 2f 73 69 7a 65 6f |>sizeof(|e)/sizeo|
|000009d0| 66 28 65 5b 30 5d 29 29 | 6e 3d 73 69 7a 65 6f 66 |f(e[0]))|n=sizeof|
|000009e0| 28 65 29 2f 73 69 7a 65 | 6f 66 28 65 5b 30 5d 29 |(e)/size|of(e[0])|
|000009f0| 3b 0d 09 66 6f 72 28 69 | 3d 30 2c 4c 3d 4c 30 3b |;..for(i|=0,L=L0;|
|00000a00| 69 3c 6e 3b 69 2b 2b 2c | 4c 2b 3d 64 4c 29 7b 0d |i<n;i++,|L+=dL){.|
|00000a10| 09 09 4c 47 6f 74 3d 47 | 65 74 4c 75 6d 69 6e 61 |..LGot=G|etLumina|
|00000a20| 6e 63 65 28 4e 55 4c 4c | 2c 26 4c 52 2c 69 29 3b |nce(NULL|,&LR,i);|
|00000a30| 0d 09 09 65 5b 69 5d 3d | 4c 47 6f 74 2d 4c 3b 0d |...e[i]=|LGot-L;.|
|00000a40| 09 09 69 66 28 69 25 31 | 36 3d 3d 30 29 70 72 69 |..if(i%1|6==0)pri|
|00000a50| 6e 74 66 28 22 25 31 30 | 2e 33 66 20 25 31 30 2e |ntf("%10|.3f %10.|
|00000a60| 33 66 20 25 31 30 2e 33 | 66 5c 6e 22 2c 4c 2c 4c |3f %10.3|f\n",L,L|
|00000a70| 47 6f 74 2c 4c 47 6f 74 | 2d 4c 29 3b 0d 09 7d 0d |Got,LGot|-L);..}.|
|00000a80| 09 6d 65 61 6e 3d 4d 65 | 61 6e 28 65 2c 6e 2c 26 |.mean=Me|an(e,n,&|
|00000a90| 73 64 29 3b 0d 09 6d 61 | 78 3d 30 2e 30 3b 0d 09 |sd);..ma|x=0.0;..|
|00000aa0| 66 6f 72 28 69 3d 30 3b | 69 3c 6e 3b 69 2b 2b 29 |for(i=0;|i<n;i++)|
|00000ab0| 69 66 28 66 61 62 73 28 | 6d 61 78 29 3c 66 61 62 |if(fabs(|max)<fab|
|00000ac0| 73 28 65 5b 69 5d 29 29 | 6d 61 78 3d 65 5b 69 5d |s(e[i]))|max=e[i]|
|00000ad0| 3b 0d 09 70 72 69 6e 74 | 66 28 22 45 72 72 6f 72 |;..print|f("Error|
|00000ae0| 20 6d 65 61 6e 20 25 66 | 20 73 64 20 25 66 20 6d | mean %f| sd %f m|
|00000af0| 61 78 20 25 66 5c 6e 5c | 6e 22 2c 6d 65 61 6e 2c |ax %f\n\|n",mean,|
|00000b00| 73 64 2c 6d 61 78 29 3b | 0d 09 0d 09 70 72 69 6e |sd,max);|....prin|
|00000b10| 74 66 28 22 54 65 73 74 | 20 56 54 6f 4c 20 61 6e |tf("Test| VToL an|
|00000b20| 64 20 4c 54 6f 56 5c 6e | 22 29 3b 0d 09 70 72 69 |d LToV\n|");..pri|
|00000b30| 6e 74 66 28 22 25 31 30 | 73 20 25 31 30 73 20 25 |ntf("%10|s %10s %|
|00000b40| 31 30 73 5c 6e 22 2c 22 | 4c 20 72 65 71 75 65 73 |10s\n","|L reques|
|00000b50| 74 65 64 22 2c 22 56 20 | 72 65 63 65 69 76 65 64 |ted","V |received|
|00000b60| 22 2c 22 4c 20 72 65 63 | 65 69 76 65 64 22 29 3b |","L rec|eived");|
|00000b70| 0d 09 66 6f 72 28 4c 3d | 2d 31 30 2e 30 3b 4c 3c |..for(L=|-10.0;L<|
|00000b80| 31 30 30 2e 30 3b 4c 2b | 3d 32 30 2e 30 29 7b 0d |100.0;L+|=20.0){.|
|00000b90| 09 09 56 3d 4c 54 6f 56 | 28 26 4c 52 2c 4c 29 3b |..V=LToV|(&LR,L);|
|00000ba0| 0d 09 09 70 72 69 6e 74 | 66 28 22 25 39 2e 30 66 |...print|f("%9.0f|
|00000bb0| 20 25 39 2e 31 66 20 25 | 31 32 2e 36 66 5c 6e 22 | %9.1f %|12.6f\n"|
|00000bc0| 2c 4c 2c 56 2c 56 54 6f | 4c 28 26 4c 52 2c 56 29 |,L,V,VTo|L(&LR,V)|
|00000bd0| 29 3b 0d 09 7d 0d 0d 09 | 72 65 70 73 3d 31 30 30 |);..}...|reps=100|
|00000be0| 30 3b 0d 09 74 3d 54 69 | 63 6b 43 6f 75 6e 74 28 |0;..t=Ti|ckCount(|
|00000bf0| 29 3b 0d 09 56 3d 4c 52 | 2e 56 4d 69 6e 3b 0d 09 |);..V=LR|.VMin;..|
|00000c00| 64 56 3d 28 4c 52 2e 56 | 4d 61 78 2d 56 29 2f 72 |dV=(LR.V|Max-V)/r|
|00000c10| 65 70 73 2f 34 3b 0d 09 | 66 6f 72 28 69 3d 72 65 |eps/4;..|for(i=re|
|00000c20| 70 73 2f 34 3b 69 3e 30 | 3b 69 2d 2d 29 20 7b 0d |ps/4;i>0|;i--) {.|
|00000c30| 09 09 56 3d 56 54 6f 4c | 28 26 4c 52 2c 56 29 3b |..V=VToL|(&LR,V);|
|00000c40| 0d 09 09 56 3d 56 54 6f | 4c 28 26 4c 52 2c 56 29 |...V=VTo|L(&LR,V)|
|00000c50| 3b 0d 09 09 56 3d 56 54 | 6f 4c 28 26 4c 52 2c 56 |;...V=VT|oL(&LR,V|
|00000c60| 29 3b 0d 09 09 56 3d 56 | 54 6f 4c 28 26 4c 52 2c |);...V=V|ToL(&LR,|
|00000c70| 56 29 3b 0d 09 09 56 2b | 3d 64 56 3b 0d 09 7d 0d |V);...V+|=dV;..}.|
|00000c80| 09 74 3d 54 69 63 6b 43 | 6f 75 6e 74 28 29 2d 74 |.t=TickC|ount()-t|
|00000c90| 3b 0d 09 70 72 69 6e 74 | 66 28 22 56 54 6f 4c 20 |;..print|f("VToL |
|00000ca0| 74 61 6b 65 73 20 25 2e | 31 66 20 b5 73 5c 6e 22 |takes %.|1f .s\n"|
|00000cb0| 2c 31 65 36 2a 74 2f 28 | 36 30 2e 31 35 2a 72 65 |,1e6*t/(|60.15*re|
|00000cc0| 70 73 29 29 3b 0d 0d 09 | 72 65 70 73 3d 31 30 30 |ps));...|reps=100|
|00000cd0| 30 3b 0d 09 74 3d 54 69 | 63 6b 43 6f 75 6e 74 28 |0;..t=Ti|ckCount(|
|00000ce0| 29 3b 0d 09 4c 3d 4c 52 | 2e 4c 4d 69 6e 3b 0d 09 |);..L=LR|.LMin;..|
|00000cf0| 64 4c 3d 28 4c 52 2e 4c | 4d 61 78 2d 4c 29 2f 72 |dL=(LR.L|Max-L)/r|
|00000d00| 65 70 73 2f 34 3b 0d 09 | 66 6f 72 28 69 3d 72 65 |eps/4;..|for(i=re|
|00000d10| 70 73 2f 34 3b 69 3e 30 | 3b 69 2d 2d 29 20 7b 0d |ps/4;i>0|;i--) {.|
|00000d20| 09 09 56 3d 4c 54 6f 56 | 28 26 4c 52 2c 4c 29 3b |..V=LToV|(&LR,L);|
|00000d30| 0d 09 09 56 3d 4c 54 6f | 56 28 26 4c 52 2c 4c 29 |...V=LTo|V(&LR,L)|
|00000d40| 3b 0d 09 09 56 3d 4c 54 | 6f 56 28 26 4c 52 2c 4c |;...V=LT|oV(&LR,L|
|00000d50| 29 3b 0d 09 09 56 3d 4c | 54 6f 56 28 26 4c 52 2c |);...V=L|ToV(&LR,|
|00000d60| 4c 29 3b 0d 09 09 4c 2b | 3d 64 4c 3b 0d 09 7d 0d |L);...L+|=dL;..}.|
|00000d70| 09 74 3d 54 69 63 6b 43 | 6f 75 6e 74 28 29 2d 74 |.t=TickC|ount()-t|
|00000d80| 3b 0d 09 70 72 69 6e 74 | 66 28 22 4c 54 6f 56 20 |;..print|f("LToV |
|00000d90| 74 61 6b 65 73 20 25 2e | 31 66 20 b5 73 5c 6e 22 |takes %.|1f .s\n"|
|00000da0| 2c 31 65 36 2a 74 2f 28 | 36 30 2e 31 35 2a 72 65 |,1e6*t/(|60.15*re|
|00000db0| 70 73 29 29 3b 0d 0d 09 | 72 65 70 73 3d 31 30 30 |ps));...|reps=100|
|00000dc0| 30 3b 0d 09 4c 30 3d 28 | 4c 52 2e 4c 4d 69 6e 2b |0;..L0=(|LR.LMin+|
|00000dd0| 4c 52 2e 4c 4d 61 78 29 | 2f 32 2e 30 3b 0d 09 4c |LR.LMax)|/2.0;..L|
|00000de0| 31 3d 31 2e 30 31 2a 4c | 30 3b 0d 09 53 65 74 4c |1=1.01*L|0;..SetL|
|00000df0| 75 6d 69 6e 61 6e 63 65 | 28 4e 55 4c 4c 2c 26 4c |uminance|(NULL,&L|
|00000e00| 52 2c 30 2c 35 30 2e 2c | 4c 30 2c 4c 31 29 3b 0d |R,0,50.,|L0,L1);.|
|00000e10| 09 4c 3d 4c 30 3b 0d 09 | 64 4c 3d 28 4c 31 2d 4c |.L=L0;..|dL=(L1-L|
|00000e20| 29 2f 72 65 70 73 2f 34 | 3b 0d 09 74 3d 54 69 63 |)/reps/4|;..t=Tic|
|00000e30| 6b 43 6f 75 6e 74 28 29 | 3b 0d 09 66 6f 72 28 69 |kCount()|;..for(i|
|00000e40| 3d 72 65 70 73 2f 34 3b | 69 3e 30 3b 69 2d 2d 29 |=reps/4;|i>0;i--)|
|00000e50| 20 7b 0d 09 09 53 65 74 | 4c 75 6d 69 6e 61 6e 63 | {...Set|Luminanc|
|00000e60| 65 28 4e 55 4c 4c 2c 26 | 4c 52 2c 30 2c 4c 2c 4c |e(NULL,&|LR,0,L,L|
|00000e70| 30 2c 4c 31 29 3b 0d 09 | 09 53 65 74 4c 75 6d 69 |0,L1);..|.SetLumi|
|00000e80| 6e 61 6e 63 65 28 4e 55 | 4c 4c 2c 26 4c 52 2c 30 |nance(NU|LL,&LR,0|
|00000e90| 2c 4c 2c 4c 30 2c 4c 31 | 29 3b 0d 09 09 53 65 74 |,L,L0,L1|);...Set|
|00000ea0| 4c 75 6d 69 6e 61 6e 63 | 65 28 4e 55 4c 4c 2c 26 |Luminanc|e(NULL,&|
|00000eb0| 4c 52 2c 30 2c 4c 2c 4c | 30 2c 4c 31 29 3b 0d 09 |LR,0,L,L|0,L1);..|
|00000ec0| 09 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 28 4e 55 |.SetLumi|nance(NU|
|00000ed0| 4c 4c 2c 26 4c 52 2c 30 | 2c 4c 2c 4c 30 2c 4c 31 |LL,&LR,0|,L,L0,L1|
|00000ee0| 29 3b 0d 09 09 4c 2b 3d | 64 4c 3b 0d 09 7d 0d 09 |);...L+=|dL;..}..|
|00000ef0| 74 3d 54 69 63 6b 43 6f | 75 6e 74 28 29 2d 74 3b |t=TickCo|unt()-t;|
|00000f00| 0d 09 70 72 69 6e 74 66 | 28 22 53 65 74 4c 75 6d |..printf|("SetLum|
|00000f10| 69 6e 61 6e 63 65 20 74 | 61 6b 65 73 20 25 2e 31 |inance t|akes %.1|
|00000f20| 66 20 b5 73 20 77 69 74 | 68 20 73 6d 61 6c 6c 20 |f .s wit|h small |
|00000f30| 6f 6c 64 20 72 61 6e 67 | 65 5c 6e 22 2c 31 65 36 |old rang|e\n",1e6|
|00000f40| 2a 74 2f 28 36 30 2e 31 | 35 2a 72 65 70 73 29 29 |*t/(60.1|5*reps))|
|00000f50| 3b 0d 0d 09 72 65 70 73 | 3d 31 30 30 30 3b 0d 09 |;...reps|=1000;..|
|00000f60| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 28 4e 55 4c |SetLumin|ance(NUL|
|00000f70| 4c 2c 26 4c 52 2c 30 2c | 35 30 2e 2c 4c 52 2e 4c |L,&LR,0,|50.,LR.L|
|00000f80| 4d 69 6e 2c 4c 52 2e 4c | 4d 61 78 29 3b 0d 09 4c |Min,LR.L|Max);..L|
|00000f90| 3d 4c 52 2e 4c 4d 69 6e | 3b 0d 09 64 4c 3d 28 4c |=LR.LMin|;..dL=(L|
|00000fa0| 52 2e 4c 4d 61 78 2d 4c | 29 2f 72 65 70 73 2f 34 |R.LMax-L|)/reps/4|
|00000fb0| 3b 0d 09 74 3d 54 69 63 | 6b 43 6f 75 6e 74 28 29 |;..t=Tic|kCount()|
|00000fc0| 3b 0d 09 66 6f 72 28 69 | 3d 72 65 70 73 2f 34 3b |;..for(i|=reps/4;|
|00000fd0| 69 3e 30 3b 69 2d 2d 29 | 20 7b 0d 09 09 53 65 74 |i>0;i--)| {...Set|
|00000fe0| 4c 75 6d 69 6e 61 6e 63 | 65 28 4e 55 4c 4c 2c 26 |Luminanc|e(NULL,&|
|00000ff0| 4c 52 2c 30 2c 4c 2c 4c | 52 2e 4c 4d 69 6e 2c 4c |LR,0,L,L|R.LMin,L|
|00001000| 52 2e 4c 4d 61 78 29 3b | 0d 09 09 53 65 74 4c 75 |R.LMax);|...SetLu|
|00001010| 6d 69 6e 61 6e 63 65 28 | 4e 55 4c 4c 2c 26 4c 52 |minance(|NULL,&LR|
|00001020| 2c 30 2c 4c 2c 4c 52 2e | 4c 4d 69 6e 2c 4c 52 2e |,0,L,LR.|LMin,LR.|
|00001030| 4c 4d 61 78 29 3b 0d 09 | 09 53 65 74 4c 75 6d 69 |LMax);..|.SetLumi|
|00001040| 6e 61 6e 63 65 28 4e 55 | 4c 4c 2c 26 4c 52 2c 30 |nance(NU|LL,&LR,0|
|00001050| 2c 4c 2c 4c 52 2e 4c 4d | 69 6e 2c 4c 52 2e 4c 4d |,L,LR.LM|in,LR.LM|
|00001060| 61 78 29 3b 0d 09 09 53 | 65 74 4c 75 6d 69 6e 61 |ax);...S|etLumina|
|00001070| 6e 63 65 28 4e 55 4c 4c | 2c 26 4c 52 2c 30 2c 4c |nce(NULL|,&LR,0,L|
|00001080| 2c 4c 52 2e 4c 4d 69 6e | 2c 4c 52 2e 4c 4d 61 78 |,LR.LMin|,LR.LMax|
|00001090| 29 3b 0d 09 09 4c 2b 3d | 64 4c 3b 0d 09 7d 0d 09 |);...L+=|dL;..}..|
|000010a0| 74 3d 54 69 63 6b 43 6f | 75 6e 74 28 29 2d 74 3b |t=TickCo|unt()-t;|
|000010b0| 0d 09 70 72 69 6e 74 66 | 28 22 53 65 74 4c 75 6d |..printf|("SetLum|
|000010c0| 69 6e 61 6e 63 65 20 74 | 61 6b 65 73 20 25 2e 31 |inance t|akes %.1|
|000010d0| 66 20 b5 73 20 77 69 74 | 68 20 6c 61 72 67 65 20 |f .s wit|h large |
|000010e0| 6f 6c 64 20 72 61 6e 67 | 65 5c 6e 22 2c 31 65 36 |old rang|e\n",1e6|
|000010f0| 2a 74 2f 28 36 30 2e 31 | 35 2a 72 65 70 73 29 29 |*t/(60.1|5*reps))|
|00001100| 3b 0d 0d 09 72 65 70 73 | 3d 32 30 30 3b 0d 09 53 |;...reps|=200;..S|
|00001110| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 28 4e 55 4c 4c |etLumina|nce(NULL|
|00001120| 2c 26 4c 52 2c 30 2c 4c | 2c 4c 52 2e 4c 4d 69 6e |,&LR,0,L|,LR.LMin|
|00001130| 2c 4c 52 2e 4c 4d 61 78 | 29 3b 0d 09 4c 3d 4c 52 |,LR.LMax|);..L=LR|
|00001140| 2e 4c 4d 69 6e 3b 0d 09 | 64 4c 3d 28 4c 52 2e 4c |.LMin;..|dL=(LR.L|
|00001150| 4d 61 78 2d 4c 29 2f 72 | 65 70 73 2f 34 3b 0d 09 |Max-L)/r|eps/4;..|
|00001160| 74 3d 54 69 63 6b 43 6f | 75 6e 74 28 29 3b 0d 09 |t=TickCo|unt();..|
|00001170| 66 6f 72 28 69 3d 72 65 | 70 73 2f 34 3b 69 3e 30 |for(i=re|ps/4;i>0|
|00001180| 3b 69 2d 2d 29 20 7b 0d | 09 09 53 65 74 4c 75 6d |;i--) {.|..SetLum|
|00001190| 69 6e 61 6e 63 65 28 4e | 55 4c 4c 2c 26 4c 52 2c |inance(N|ULL,&LR,|
|000011a0| 30 2c 4c 2c 4c 52 2e 4c | 4d 69 6e 2c 4c 52 2e 4c |0,L,LR.L|Min,LR.L|
|000011b0| 4d 61 78 2d 31 2e 30 29 | 3b 0d 09 09 53 65 74 4c |Max-1.0)|;...SetL|
|000011c0| 75 6d 69 6e 61 6e 63 65 | 28 4e 55 4c 4c 2c 26 4c |uminance|(NULL,&L|
|000011d0| 52 2c 30 2c 4c 2c 4c 52 | 2e 4c 4d 69 6e 2c 4c 52 |R,0,L,LR|.LMin,LR|
|000011e0| 2e 4c 4d 61 78 29 3b 0d | 09 09 53 65 74 4c 75 6d |.LMax);.|..SetLum|
|000011f0| 69 6e 61 6e 63 65 28 4e | 55 4c 4c 2c 26 4c 52 2c |inance(N|ULL,&LR,|
|00001200| 30 2c 4c 2c 4c 52 2e 4c | 4d 69 6e 2c 4c 52 2e 4c |0,L,LR.L|Min,LR.L|
|00001210| 4d 61 78 2d 31 2e 30 29 | 3b 0d 09 09 53 65 74 4c |Max-1.0)|;...SetL|
|00001220| 75 6d 69 6e 61 6e 63 65 | 28 4e 55 4c 4c 2c 26 4c |uminance|(NULL,&L|
|00001230| 52 2c 30 2c 4c 2c 4c 52 | 2e 4c 4d 69 6e 2c 4c 52 |R,0,L,LR|.LMin,LR|
|00001240| 2e 4c 4d 61 78 29 3b 0d | 09 09 4c 2b 3d 64 4c 3b |.LMax);.|..L+=dL;|
|00001250| 0d 09 7d 0d 09 74 3d 54 | 69 63 6b 43 6f 75 6e 74 |..}..t=T|ickCount|
|00001260| 28 29 2d 74 3b 0d 09 70 | 72 69 6e 74 66 28 22 53 |()-t;..p|rintf("S|
|00001270| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 20 74 61 6b 65 |etLumina|nce take|
|00001280| 73 20 25 2e 31 66 20 b5 | 73 20 77 69 74 68 20 6c |s %.1f .|s with l|
|00001290| 61 72 67 65 20 6e 65 77 | 20 72 61 6e 67 65 5c 6e |arge new| range\n|
|000012a0| 22 2c 31 65 36 2a 74 2f | 28 36 30 2e 31 35 2a 72 |",1e6*t/|(60.15*r|
|000012b0| 65 70 73 29 29 3b 0d 0d | 09 72 65 70 73 3d 32 30 |eps));..|.reps=20|
|000012c0| 30 3b 0d 09 53 65 74 4c | 75 6d 69 6e 61 6e 63 65 |0;..SetL|uminance|
|000012d0| 28 4e 55 4c 4c 2c 26 4c | 52 2c 30 2c 4c 30 2c 4c |(NULL,&L|R,0,L0,L|
|000012e0| 30 2c 4c 31 29 3b 0d 09 | 74 3d 54 69 63 6b 43 6f |0,L1);..|t=TickCo|
|000012f0| 75 6e 74 28 29 3b 0d 09 | 66 6f 72 28 69 3d 30 3b |unt();..|for(i=0;|
|00001300| 69 3c 72 65 70 73 2f 34 | 3b 69 2b 2b 29 20 7b 0d |i<reps/4|;i++) {.|
|00001310| 09 09 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 73 41 |..SetLum|inancesA|
|00001320| 6e 64 52 61 6e 67 65 28 | 4e 55 4c 4c 2c 26 4c 52 |ndRange(|NULL,&LR|
|00001330| 2c 30 2c 32 35 35 2c 4c | 30 2c 4c 31 2c 4c 30 2c |,0,255,L|0,L1,L0,|
|00001340| 4c 31 29 3b 0d 09 09 53 | 65 74 4c 75 6d 69 6e 61 |L1);...S|etLumina|
|00001350| 6e 63 65 73 41 6e 64 52 | 61 6e 67 65 28 4e 55 4c |ncesAndR|ange(NUL|
|00001360| 4c 2c 26 4c 52 2c 30 2c | 32 35 35 2c 4c 30 2c 4c |L,&LR,0,|255,L0,L|
|00001370| 31 2c 4c 30 2c 4c 31 29 | 3b 0d 09 09 53 65 74 4c |1,L0,L1)|;...SetL|
|00001380| 75 6d 69 6e 61 6e 63 65 | 73 41 6e 64 52 61 6e 67 |uminance|sAndRang|
|00001390| 65 28 4e 55 4c 4c 2c 26 | 4c 52 2c 30 2c 32 35 35 |e(NULL,&|LR,0,255|
|000013a0| 2c 4c 30 2c 4c 31 2c 4c | 30 2c 4c 31 29 3b 0d 09 |,L0,L1,L|0,L1);..|
|000013b0| 09 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 41 6e |.SetLumi|nancesAn|
|000013c0| 64 52 61 6e 67 65 28 4e | 55 4c 4c 2c 26 4c 52 2c |dRange(N|ULL,&LR,|
|000013d0| 30 2c 32 35 35 2c 4c 30 | 2c 4c 31 2c 4c 30 2c 4c |0,255,L0|,L1,L0,L|
|000013e0| 31 29 3b 0d 09 7d 0d 09 | 74 3d 54 69 63 6b 43 6f |1);..}..|t=TickCo|
|000013f0| 75 6e 74 28 29 2d 74 3b | 0d 09 70 72 69 6e 74 66 |unt()-t;|..printf|
|00001400| 28 22 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 73 41 |("SetLum|inancesA|
|00001410| 6e 64 52 61 6e 67 65 28 | 30 2e 2e 32 35 35 29 20 |ndRange(|0..255) |
|00001420| 74 61 6b 65 73 20 25 2e | 31 66 20 6d 73 20 77 69 |takes %.|1f ms wi|
|00001430| 74 68 20 73 6d 61 6c 6c | 20 6f 6c 64 20 72 61 6e |th small| old ran|
|00001440| 67 65 5c 6e 22 2c 31 30 | 30 30 2e 30 2a 74 2f 28 |ge\n",10|00.0*t/(|
|00001450| 36 30 2e 31 35 2a 72 65 | 70 73 29 29 3b 0d 0d 23 |60.15*re|ps));..#|
|00001460| 69 66 20 31 0d 09 72 65 | 70 73 3d 34 38 3b 0d 09 |if 1..re|ps=48;..|
|00001470| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 28 4e 55 4c |SetLumin|ance(NUL|
|00001480| 4c 2c 26 4c 52 2c 30 2c | 4c 30 2c 4c 30 2c 4c 31 |L,&LR,0,|L0,L0,L1|
|00001490| 29 3b 0d 09 74 3d 54 69 | 63 6b 43 6f 75 6e 74 28 |);..t=Ti|ckCount(|
|000014a0| 29 3b 0d 09 66 6f 72 28 | 69 3d 30 3b 69 3c 72 65 |);..for(|i=0;i<re|
|000014b0| 70 73 2f 34 3b 69 2b 2b | 29 20 7b 0d 09 09 53 65 |ps/4;i++|) {...Se|
|000014c0| 74 4c 75 6d 69 6e 61 6e | 63 65 73 41 6e 64 52 61 |tLuminan|cesAndRa|
|000014d0| 6e 67 65 28 4e 55 4c 4c | 2c 26 4c 52 2c 30 2c 32 |nge(NULL|,&LR,0,2|
|000014e0| 35 35 2c 4c 30 2c 4c 31 | 2c 4c 30 2c 4c 31 2a 31 |55,L0,L1|,L0,L1*1|
|000014f0| 2e 30 30 31 29 3b 0d 09 | 09 53 65 74 4c 75 6d 69 |.001);..|.SetLumi|
|00001500| 6e 61 6e 63 65 73 41 6e | 64 52 61 6e 67 65 28 4e |nancesAn|dRange(N|
|00001510| 55 4c 4c 2c 26 4c 52 2c | 30 2c 32 35 35 2c 4c 30 |ULL,&LR,|0,255,L0|
|00001520| 2c 4c 31 2c 4c 30 2c 4c | 31 29 3b 0d 09 09 53 65 |,L1,L0,L|1);...Se|
|00001530| 74 4c 75 6d 69 6e 61 6e | 63 65 73 41 6e 64 52 61 |tLuminan|cesAndRa|
|00001540| 6e 67 65 28 4e 55 4c 4c | 2c 26 4c 52 2c 30 2c 32 |nge(NULL|,&LR,0,2|
|00001550| 35 35 2c 4c 30 2c 4c 31 | 2c 4c 30 2c 4c 31 2a 31 |55,L0,L1|,L0,L1*1|
|00001560| 2e 30 30 31 29 3b 0d 09 | 09 53 65 74 4c 75 6d 69 |.001);..|.SetLumi|
|00001570| 6e 61 6e 63 65 73 41 6e | 64 52 61 6e 67 65 28 4e |nancesAn|dRange(N|
|00001580| 55 4c 4c 2c 26 4c 52 2c | 30 2c 32 35 35 2c 4c 30 |ULL,&LR,|0,255,L0|
|00001590| 2c 4c 31 2c 4c 30 2c 4c | 31 29 3b 0d 09 7d 0d 09 |,L1,L0,L|1);..}..|
|000015a0| 74 3d 54 69 63 6b 43 6f | 75 6e 74 28 29 2d 74 3b |t=TickCo|unt()-t;|
|000015b0| 0d 09 70 72 69 6e 74 66 | 28 22 53 65 74 4c 75 6d |..printf|("SetLum|
|000015c0| 69 6e 61 6e 63 65 73 41 | 6e 64 52 61 6e 67 65 28 |inancesA|ndRange(|
|000015d0| 30 2e 2e 32 35 35 29 20 | 74 61 6b 65 73 20 25 2e |0..255) |takes %.|
|000015e0| 31 66 20 6d 73 20 77 69 | 74 68 20 73 6d 61 6c 6c |1f ms wi|th small|
|000015f0| 20 6e 65 77 20 72 61 6e | 67 65 5c 6e 22 2c 31 30 | new ran|ge\n",10|
|00001600| 30 30 2e 30 2a 74 2f 28 | 36 30 2e 31 35 2a 72 65 |00.0*t/(|60.15*re|
|00001610| 70 73 29 29 3b 0d 23 65 | 6e 64 69 66 0d 0d 09 72 |ps));.#e|ndif...r|
|00001620| 65 70 73 3d 34 38 3b 0d | 09 53 65 74 4c 75 6d 69 |eps=48;.|.SetLumi|
|00001630| 6e 61 6e 63 65 28 4e 55 | 4c 4c 2c 26 4c 52 2c 30 |nance(NU|LL,&LR,0|
|00001640| 2c 35 30 2e 2c 4c 52 2e | 4c 4d 69 6e 2c 4c 52 2e |,50.,LR.|LMin,LR.|
|00001650| 4c 4d 61 78 29 3b 0d 09 | 74 3d 54 69 63 6b 43 6f |LMax);..|t=TickCo|
|00001660| 75 6e 74 28 29 3b 0d 09 | 66 6f 72 28 69 3d 30 3b |unt();..|for(i=0;|
|00001670| 69 3c 72 65 70 73 2f 32 | 3b 69 2b 2b 29 20 7b 0d |i<reps/2|;i++) {.|
|00001680| 09 09 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 73 41 |..SetLum|inancesA|
|00001690| 6e 64 52 61 6e 67 65 28 | 4e 55 4c 4c 2c 26 4c 52 |ndRange(|NULL,&LR|
|000016a0| 2c 30 2c 32 35 35 2c 4c | 52 2e 4c 4d 69 6e 2c 4c |,0,255,L|R.LMin,L|
|000016b0| 52 2e 4c 4d 61 78 2c 4c | 52 2e 4c 4d 69 6e 2c 4c |R.LMax,L|R.LMin,L|
|000016c0| 52 2e 4c 4d 61 78 29 3b | 0d 09 09 53 65 74 4c 75 |R.LMax);|...SetLu|
|000016d0| 6d 69 6e 61 6e 63 65 73 | 41 6e 64 52 61 6e 67 65 |minances|AndRange|
|000016e0| 28 4e 55 4c 4c 2c 26 4c | 52 2c 30 2c 32 35 35 2c |(NULL,&L|R,0,255,|
|000016f0| 4c 52 2e 4c 4d 69 6e 2c | 4c 52 2e 4c 4d 61 78 2c |LR.LMin,|LR.LMax,|
|00001700| 4c 52 2e 4c 4d 69 6e 2c | 4c 52 2e 4c 4d 61 78 29 |LR.LMin,|LR.LMax)|
|00001710| 3b 0d 09 7d 0d 09 74 3d | 54 69 63 6b 43 6f 75 6e |;..}..t=|TickCoun|
|00001720| 74 28 29 2d 74 3b 0d 09 | 70 72 69 6e 74 66 28 22 |t()-t;..|printf("|
|00001730| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 73 41 6e 64 |SetLumin|ancesAnd|
|00001740| 52 61 6e 67 65 28 30 2e | 2e 32 35 35 29 20 74 61 |Range(0.|.255) ta|
|00001750| 6b 65 73 20 25 2e 31 66 | 20 6d 73 20 77 69 74 68 |kes %.1f| ms with|
|00001760| 20 6c 61 72 67 65 20 6f | 6c 64 20 72 61 6e 67 65 | large o|ld range|
|00001770| 5c 6e 22 2c 31 30 30 30 | 2e 30 2a 74 2f 28 36 30 |\n",1000|.0*t/(60|
|00001780| 2e 31 35 2a 72 65 70 73 | 29 29 3b 0d 0d 23 69 66 |.15*reps|));..#if|
|00001790| 20 31 0d 09 72 65 70 73 | 3d 34 38 3b 0d 09 53 65 | 1..reps|=48;..Se|
|000017a0| 74 4c 75 6d 69 6e 61 6e | 63 65 28 4e 55 4c 4c 2c |tLuminan|ce(NULL,|
|000017b0| 26 4c 52 2c 30 2c 35 30 | 2e 2c 4c 52 2e 4c 4d 69 |&LR,0,50|.,LR.LMi|
|000017c0| 6e 2c 4c 52 2e 4c 4d 61 | 78 29 3b 0d 09 74 3d 54 |n,LR.LMa|x);..t=T|
|000017d0| 69 63 6b 43 6f 75 6e 74 | 28 29 3b 0d 09 66 6f 72 |ickCount|();..for|
|000017e0| 28 69 3d 30 3b 69 3c 72 | 65 70 73 2f 32 3b 69 2b |(i=0;i<r|eps/2;i+|
|000017f0| 2b 29 20 7b 0d 09 09 53 | 65 74 4c 75 6d 69 6e 61 |+) {...S|etLumina|
|00001800| 6e 63 65 73 41 6e 64 52 | 61 6e 67 65 28 4e 55 4c |ncesAndR|ange(NUL|
|00001810| 4c 2c 26 4c 52 2c 30 2c | 32 35 35 2c 4c 52 2e 4c |L,&LR,0,|255,LR.L|
|00001820| 4d 69 6e 2c 4c 52 2e 4c | 4d 61 78 2d 31 2e 30 2c |Min,LR.L|Max-1.0,|
|00001830| 4c 52 2e 4c 4d 69 6e 2c | 4c 52 2e 4c 4d 61 78 2d |LR.LMin,|LR.LMax-|
|00001840| 31 2e 30 29 3b 0d 09 09 | 53 65 74 4c 75 6d 69 6e |1.0);...|SetLumin|
|00001850| 61 6e 63 65 73 41 6e 64 | 52 61 6e 67 65 28 4e 55 |ancesAnd|Range(NU|
|00001860| 4c 4c 2c 26 4c 52 2c 30 | 2c 32 35 35 2c 4c 52 2e |LL,&LR,0|,255,LR.|
|00001870| 4c 4d 69 6e 2c 4c 52 2e | 4c 4d 61 78 2d 31 2e 30 |LMin,LR.|LMax-1.0|
|00001880| 2c 4c 52 2e 4c 4d 69 6e | 2c 4c 52 2e 4c 4d 61 78 |,LR.LMin|,LR.LMax|
|00001890| 29 3b 0d 09 7d 0d 09 74 | 3d 54 69 63 6b 43 6f 75 |);..}..t|=TickCou|
|000018a0| 6e 74 28 29 2d 74 3b 0d | 09 70 72 69 6e 74 66 28 |nt()-t;.|.printf(|
|000018b0| 22 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 41 6e |"SetLumi|nancesAn|
|000018c0| 64 52 61 6e 67 65 28 30 | 2e 2e 32 35 35 29 20 74 |dRange(0|..255) t|
|000018d0| 61 6b 65 73 20 25 2e 31 | 66 20 6d 73 20 77 69 74 |akes %.1|f ms wit|
|000018e0| 68 20 6c 61 72 67 65 20 | 6e 65 77 20 72 61 6e 67 |h large |new rang|
|000018f0| 65 5c 6e 22 2c 31 30 30 | 30 2e 30 2a 74 2f 28 36 |e\n",100|0.0*t/(6|
|00001900| 30 2e 31 35 2a 72 65 70 | 73 29 29 3b 0d 23 65 6e |0.15*rep|s));.#en|
|00001910| 64 69 66 0d 09 23 69 66 | 20 5f 5f 4d 57 45 52 4b |dif..#if| __MWERK|
|00001920| 53 5f 5f 0d 09 09 70 72 | 69 6e 74 66 28 22 44 6f |S__...pr|intf("Do|
|00001930| 6e 65 2e 20 48 69 74 20 | 43 6f 6d 6d 61 6e 64 2d |ne. Hit |Command-|
|00001940| 51 20 74 6f 20 71 75 69 | 74 2e 5c 6e 22 29 3b 0d |Q to qui|t.\n");.|
|00001950| 09 23 65 6e 64 69 66 0d | 7d 09 0d 0d 0d 00 00 00 |.#endif.|}.......|
|00001960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001980| 00 00 01 00 00 00 01 7e | 00 00 00 7e 00 00 00 52 |.......~|...~...R|
|00001990| 3d 39 3b 09 2f 2a 20 23 | 6f 66 20 63 6f 65 66 66 |=9;./* #|of coeff|
|000019a0| 69 63 69 65 6e 74 73 20 | 69 6e 20 70 6f 6c 79 6e |icients |in polyn|
|000019b0| 0f 54 65 73 74 4c 75 6d | 69 6e 61 6e 63 65 2e 63 |.TestLum|inance.c|
|000019c0| 02 00 00 00 50 61 72 74 | 53 49 54 21 00 00 00 00 |....Part|SIT!....|
|000019d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 ab bf ee 52 00 00 | 00 00 00 00 01 d0 5b 33 |.....R..|......[3|
|00001a00| 5d 3d 2d 30 2e 30 30 30 | 31 38 36 38 34 32 3b 0d |]=-0.000|186842;.|
|00001a10| 09 4c 52 2e 70 5b 34 5d | 3d 33 2e 34 38 36 31 37 |.LR.p[4]|=3.48617|
|00001a20| 65 2d 30 36 3b 0d 09 4c | 52 2e 70 5b 35 5d 3d 2d |e-06;..L|R.p[5]=-|
|00001a30| 33 2e 31 37 38 32 31 65 | 2d 30 38 3b 0d 09 4c 52 |3.17821e|-08;..LR|
|00001a40| 2e 70 5b 36 5d 3d 31 2e | 35 35 38 37 34 65 2d 31 |.p[6]=1.|55874e-1|
|00001a50| 30 3b 0d 09 4c 52 2e 70 | 5b 37 5d 3d 2d 33 2e 38 |0;..LR.p|[7]=-3.8|
|00001a60| 39 37 34 35 65 2d 31 33 | 3b 0d 09 4c 52 2e 70 5b |9745e-13|;..LR.p[|
|00001a70| 38 5d 3d 33 2e 38 36 33 | 34 65 2d 31 36 3b 0d 09 |8]=3.863|4e-16;..|
|00001a80| 00 00 00 26 00 02 00 00 | 02 09 00 00 02 0d 05 6d |...&....|.......m|
|00001a90| 61 69 6e 00 00 00 02 49 | 00 00 02 56 0d 54 65 73 |ain....I|...V.Tes|
|00001aa0| 74 4c 75 6d 69 6e 61 6e | 63 65 00 00 00 48 00 09 |tLuminan|ce...H..|
|00001ab0| 4d 6f 6e 61 63 6f 00 00 | 00 00 00 00 00 00 00 00 |Monaco..|........|
|00001ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ad0| 00 03 00 04 00 3c 00 03 | 01 8c 02 7d 00 3c 00 03 |.....<..|...}.<..|
|00001ae0| 01 8c 02 7d ab 4a 2f 9f | 00 00 18 d7 00 00 18 d7 |...}.J/.|........|
|00001af0| 00 00 15 31 00 00 00 00 | 00 04 00 01 00 01 00 00 |...1....|........|
|00001b00| 01 00 00 00 01 7e 00 00 | 00 7e 00 00 00 52 01 d1 |.....~..|.~...R..|
|00001b10| 89 a8 24 ba 00 00 00 1c | 00 52 00 01 4d 50 53 52 |..$.....|.R..MPSR|
|00001b20| 00 01 00 12 4d 57 42 42 | 00 00 00 2a 03 ef ff ff |....MWBB|...*....|
|00001b30| 00 00 00 00 00 00 00 00 | 03 ed ff ff 00 00 00 2a |........|.......*|
|00001b40| 00 00 00 00 03 f0 ff ff | 00 00 00 76 00 00 00 00 |........|...v....|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+